using System.Runtime.CompilerServices;
using SageKing.Designer.Core.Contracts;
using SageKing.Designer.Core.Models;
using SageKing.Designer.Core.Activities.Flowchart.Attributes;
using SageKing.Designer.Core.Activities.Flowchart.Models;
using SageKing.Designer.Core.Attributes;
using SageKing.Designer.Core.Models;

using JetBrains.Annotations;

namespace SageKing.Designer.Core.Activities.Flowchart.Activities;

/// <summary>
/// Evaluates the specified case conditions and schedules the one that evaluates to <code>true</code>.
/// </summary>
[FlowNode("Default")]
[Activity("SageKing", "Branching", "Evaluate a set of case conditions and schedule the activity for a matching case.", DisplayName = "Switch (flow)")]
[PublicAPI]
public class FlowSwitch : Activity
{
    /// <inheritdoc />
    public FlowSwitch([CallerFilePath] string? source = default, [CallerLineNumber] int? line = default) : base(source, line)
    {
    }

    /// <summary>
    /// The possible cases to evaluate.
    /// </summary>
    [Input(UIHint = "flow-switch-editor")]
    public ICollection<FlowSwitchCase> Cases { get; set; } = new List<FlowSwitchCase>();

    /// <summary>
    /// The switch mode determines whether the first match should be scheduled, or all matches.
    /// </summary>
    [Input(
        Description = "The switch mode determines whether the first match should be scheduled, or all matches.",
        UIHint = InputUIHints.DropDown
    )]
    public Input<SwitchMode> Mode { get; set; } = new(SwitchMode.MatchFirst);
     
}